Predictive resource identification and phased delivery of structured documents

ABSTRACT

In one embodiment, a method includes, by a client device, sending a request to a computer server system for a structured document; receiving, from the computer server in a first response phase, a first response portion comprising one or more first resources associated with the structured document or references to the one or more first resources; processing the one or more first resources for rendering a part of the structured document; and receiving, from the computer system in a second response phase that is subsequent to the first response phase, a second response portion from comprising one or more second resources associated with the structured document or references to the one or more second resources, the one or more second resources being different than the one or more first resources.

PRIORITY

This application is a continuation under 35 U.S.C. § 120 of U.S. patentapplication Ser. No. 15/277385, filed Sep. 27, 2016, which is acontinuation under 35 U.S.C. § 120 of U.S. patent application Ser. No.13/285108, filed Oct. 31, 2011 and issued as U.S. Pat. No. 9,471,705,which is a continuation under 35 U.S.C. § 120 of U.S. patent applicationSer. No. 12/638910, filed Dec. 15, 2009 and issued as U.S. Pat. No.8,108,377.

TECHNICAL FIELD

The present disclosure relates generally to serving structured documents(such as web pages) to remote clients and, more particularly, to usingpredictive resource identification and phased, partial delivery ofstructured documents for use in efficiently rendering structureddocuments and decreasing perceived rendering time.

BACKGROUND

Conventionally, when a request for a web page or other structureddocument transmitted by a client device is received by a server orcomputing system hosting the web page, the hosting system typicallygenerates a base web page in the form of an Hyper Text Markup Language(HTML), Extensible Markup Language (XML), or other web browser-supportedstructured document. The generated structured document is thentransmitted as a whole in a response to the requesting client via aHypertext Transfer Protocol (HTTP) or other suitable connection forrendering at the client device. The structured document may include oneor more resources (e.g. a JavaScript script or resource, a CascadingStyle Sheet (CSS) resource, an image, a video, etc.), or references tosuch resources, embedded within the transmitted document. By way ofexample, a resource embedded in an HTML document may generally beincluded or specified within a script element, image element, or objectelement, among others, depending on the type of resource. The elementreferencing or specifying the resource may include a source attribute(e.g., src) identifying a location of the resource to the clientrequesting the web page. Typically, upon receipt of the response, theweb browser or other client application running at the client devicethen constructs a document object model (DOM) representation of thereceived structured document and requests the resource(s) (which may beat one or more other external locations) embedded in the document.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an example network environment.

FIG. 2 illustrates a block diagram of example components of an examplenetworking system.

FIG. 3 shows a flowchart illustrating an example method for constructingor populating a resource prediction table.

FIG. 4 shows a flowchart illustrating an example method for serving arequest for a web page.

FIG. 5 illustrates an exemplary computer system architecture.

DESCRIPTION OF EXAMPLE EMBODIMENTS

Particular embodiments relate to efficiently generating and renderingweb pages and other structured documents. Particular embodiments relateto accessing a resource utilization log to predict what resources may berequired for a particular web page before the web page is actuallygenerated and transmitted to a client computing device, or evenrequested by a client computing device. More specifically, in particularembodiments, when a web page (such as a profile page, home page, orcanvas page) requested by a client computing device is generated by aserver or system hosting the web page, one or more servers, databases(e.g., MySQL), and/or data warehouses log the underlying resourcesincluded in or specified in the response to the request that arerequired for rendering that particular web page at the client device. Inparticular embodiments, the one or more servers, databases, and/or datawarehouses log some or all of the requests transmitted from some or allof the users and corresponding client computing devices associated withthe web site or system hosting the web page. In particular embodiments,an offline process scans and filters the resource utilization log togenerate a data array that associates selected web pages with one ormore corresponding resources that, based on the analysis of the resourceutilization log, are statistically determined to be likely required forrendering the corresponding web page at a client device in response to asubsequent request for the web page at a later time point. That is, inparticular embodiments, only those resources that are determined to bestatistically likely to be required are included in the data array.

Particular embodiments further relate to a phased approach to serving arequested structured document, such as a web page. In particularembodiments, when a request for a particular web page is received by thehost server or system, the host checks a data array to identify theresources that are likely to be required in rendering the web page. Inparticular embodiments, the host transmits these resources, orreferences to these resources, in a first response or first responseportion that corresponds to a first portion of the requested web page.Subsequently, the host proceeds to generate the remainder of therequested web page and formulates a second response or second responseportion that includes the rest of the web page and resources, orreferences to such resources, not transmitted in the first responseportion. That is, while the host generates the entire web page, onlythose resources not included in the first response portion are includedin the second response portion and subsequently transmitted to theclient device. In this way, the client device may start downloading theresources identified in the first response portion, such as embeddedscripts and style sheets, while the rest of the web page is beinggenerated by the host, thereby potentially reducing the time required torender the web page at the client device. In particular embodiments, allresources actually required for rendering the web page (as determinedwhen the web page is generated by the host) are logged in the resourceutilization log, while resources not used to render the web page,including unused or unnecessary resources sent in the first responseportion, are not logged in the resource utilization log.

In various example embodiments, one or more described web pages may beassociated with a social networking system. However, alternateembodiments may have application to the retrieval and rendering ofstructured documents hosted by any type of network addressable resourceor web site. Additionally, as used herein, a “user” may be anindividual, a group, or an entity (such as a business or third-partyapplication).

Particular embodiments may operate in a wide area network environment,such as the Internet, including multiple network addressable systems.FIG. 1 illustrates an example network environment, in which variousexample embodiments may operate. Network cloud 60 generally representsone or more interconnected networks, over which the systems and hostsdescribed herein can communicate. Network cloud 60 may includepacket-based wide area networks (such as the Internet), privatenetworks, wireless networks, satellite networks, cellular networks,paging networks, and the like. As FIG. 1 illustrates, particularembodiments may operate in a network environment comprising socialnetworking system 20 and one or more client devices 30. Client devices30 are operably connected to the network environment via a networkservice provider, a wireless carrier, or any other suitable means.

In one example embodiment, social networking system 20 comprisescomputing systems that allow users to communicate or otherwise interactwith each other and access content, such as user profiles, as describedherein. Social networking system 20 is a network addressable systemthat, in various example embodiments, comprises one or more physicalservers 22 and data store 24. The one or more physical servers 22 areoperably connected to computer network 60 via, by way of example, a setof routers and/or networking switches 26. In an example embodiment, thefunctionality hosted by the one or more physical servers 22 may includeweb or HTTP servers, FTP servers, as well as, without limitation, webpages and applications implemented using Common Gateway Interface (CGI)script, PHP Hyper-text Preprocessor (PHP), Active Server Pages (ASP),Hyper Text Markup Language (HTML), Extensible Markup Language (XML),Java, JavaScript, Asynchronous JavaScript and XML (AJAX), and the like.

Physical servers 22 may host functionality directed to the operations ofsocial networking system 20. By way of example, social networking system20 may host a website that allows one or more users, at one or moreclient devices 30, to view and post information, as well as communicatewith one another via the website. Hereinafter servers 22 may be referredto as server 22, although server 22 may include numerous servershosting, for example, social networking system 20, as well as othercontent distribution servers, data stores, and databases. Data store 24may store content and data relating to, and enabling, operation of thesocial networking system as digital data objects. A data object, inparticular implementations, is an item of digital information typicallystored or embodied in a data file, database or record. Content objectsmay take many forms, including: text (e.g., ASCII, SGML, HTML), images(e.g., jpeg, tif and gif), graphics (vector-based or bitmap), audio,video (e.g., mpeg), or other multimedia, and combinations thereof.Content object data may also include executable code objects (e.g.,games executable within a browser window or frame), podcasts, etc.Logically, data store 24 corresponds to one or more of a variety ofseparate and integrated databases, such as relational databases andobject-oriented databases, that maintain information as an integratedcollection of logically related records or files stored on one or morephysical systems. Structurally, data store 24 may generally include oneor more of a large class of data storage and management systems. Inparticular embodiments, data store 24 may be implemented by any suitablephysical system(s) including components, such as one or more databaseservers, mass storage media, media library systems, storage areanetworks, data storage clouds, and the like. In one example embodiment,data store 24 includes one or more servers, databases (e.g., MySQL),and/or data warehouses.

Data store 24 may include data associated with different socialnetworking system 20 users and/or client devices 30. In particularembodiments, the social networking system 20 maintains a user profilefor each user of the system 20. User profiles include data that describethe users of a social network, which may include, for example, propernames (first, middle and last of a person, a trade name and/or companyname of a business entity, etc.) biographic, demographic, and othertypes of descriptive information, such as work experience, educationalhistory, hobbies or preferences, geographic location, and additionaldescriptive data. By way of example, user profiles may include a user'sbirthday, relationship status, city of residence, and the like. Thesystem 20 may further store data describing one or more relationshipsbetween different users. The relationship information may indicate userswho have similar or common work experience, group memberships, hobbies,or educational history. A user profile may also include privacy settingsgoverning access to the user's information is to other users.

Client device 30 is generally a computer or computing device includingfunctionality for communicating (e.g., remotely) over a computernetwork. Client device 30 may be a desktop computer, laptop computer,personal digital assistant (PDA), in- or out-of-car navigation system,smart phone or other cellular or mobile phone, or mobile gaming device,among other suitable computing devices. Client device 30 may execute oneor more client applications, such as a web browser (e.g., MicrosoftWindows Internet Explorer, Mozilla Firefox, Apple Safari, Google Chrome,and Opera, etc.), to access and view content over a computer network. Inparticular implementations, the client applications allow a user ofclient device 30 to enter addresses of specific network resources to beretrieved, such as resources hosted by social networking system 20.These addresses can be Uniform Resource Locators, or URLs. In addition,once a page or other resource has been retrieved, the clientapplications may provide access to other pages or records when the user“clicks” on hyperlinks to other resources. By way of example, suchhyperlinks may be located within the web pages and provide an automatedway for the user to enter the URL of another page and to retrieve thatpage.

A web page or resource embedded within a web page, which may itselfinclude multiple embedded resources, may include data records, such asplain textual information, or more complex digitally encoded multimediacontent, such as software programs or other code objects, graphics,images, audio signals, videos, and so forth. One prevalent markuplanguage for creating web pages is the Hypertext Markup Language (HTML).Other common web browser-supported languages and technologies includethe Extensible Markup Language (XML), the Extensible Hypertext MarkupLanguage (XHTML), JavaScript, Cascading Style Sheet (CSS), and,frequently, Java. By way of example, HTML enables a page developer tocreate a structured document by denoting structural semantics for textand links, as well as images, web applications and other objects thatcan be embedded within the page. Generally, a web page may be deliveredto a client as a static document, however, through the use of webelements embedded in the page, an interactive experience may be achievedwith the page or a sequence of pages. During a user session at theclient, the web browser interprets and displays the pages and associatedresources received or retrieved from the website hosting the page, aswell as, potentially, resources from other web sites.

More particularly, HTML enables developers to embed objects orresources, including web applications, images, or videos, within astructured document such as a web page. Generally, an HTML structureddocument is written in the form of HTML elements that consist of tags(surrounded by angle brackets) within the structured document content,which act as indicators to a web browser rendering the structureddocument as to how the document is to be interpreted by the web browserand ultimately presented on a user's display. By way of example, HTMLelements may represent headings, paragraphs, hypertext links, embeddedmedia, and a variety of other structures. HTML can include or can loadscripts in languages such as JavaScript, which affect the behavior ofHTML processors such as conventional web browsers, and Cascading StyleSheets (CSS), which define the appearance and layout of text and othercontent. HTML elements are the basic components for HTML and have twobasis properties: attributes and content. Each element's attribute andcontent have certain restrictions that must be followed for an HTMLelement to be considered valid. An HTML element usually has a start tag(e.g., <element-name>) and an end tag (e.g., </element-name>). Theelement's attributes are contained in the start tag and content islocated between the tags (e.g., <element-nameattribute=“value”>Content</element-name>).

By way of example, HTML elements include structural elements (e.g.,describing the purpose of text or other content), presentationalelements (e.g., describing the appearance of text or other contentregardless of its function), and Hypertext elements (e.g., making partof a document into a link to another document). Most elements can takeany of several common attributes. By way of example, the id attributeprovides a document-wide unique identifier for an element, the classattribute provides a way of classifying similar elements, and the titleattribute is used to attach subtextual explanation to an element. HTMLalso defines several data types for element content, such as script dataand stylesheet data, and numerous types for attribute values, including,by way of example, IDs, names, URIs or URLs, numbers, units of length,languages, media descriptors, colors, character encodings, dates andtimes, etc.

Document structure elements include the root element (defined by thestarting and ending tags <html> and </html>, respectively), headelements (defined by the starting and ending tags <head> and </head>,respectively), and body elements (defined by the starting and endingtags <body> and </body>, respectively). The root element tags <html> and</html> delimit the beginning and end of an HTML document, respectively.All other HTML elements of a given HTML document are included within theroot element. The head element tags <head> and </head> generally definea container for processing information and metadata for an HTMLdocument. Example document head elements found within the head elementcontainer include, by way of example and not by way of limitation, thebase element (defined by starting and ending tags <base> and </base>,respectively), which specifies a base uniform resource locator (URL) forall relative href and other links in the HTML document, the link element(defined by starting and ending tags <link> and </link>, respectively),which specifies links to other documents (e.g., for external CSS files),the meta element (defined by starting and ending tags <meta> and</meta>, respectively), which can be used to specify additional metadataabout an HTML document, the object element (defined by starting andending tags <object> and </object>, respectively), used for includinggeneric objects within the document header, the script element (definedby starting and ending tags <script> and </script>, respectively), whichcan act as a container for script instructions (e.g., JavaScript) or alink to an external script with the src (source) attribute, the styleelement (defined by starting and ending tags <style> and </style>,respectively), which specifies a style for the document and which canact as a container for style instructions (e.g., for inlined CSS rules),and the title element (defined by starting and ending tags <title> and</title>, respectively), which defines a document title.

The body element <body> represents a container for the displayablecontent of an HTML document. Example body elements include, by way ofexample and not by way of limitation, block elements (e.g., basic textand list elements, among others), inline elements (e.g., anchor andphrase elements), and image and object elements. A script elementpositioned within the body element may be used to place a script in thedocument (e.g., the script element may contain instructions todynamically generate block or inline content). The image element(defined by starting and ending tags <img> and </img>, respectively) maybe used to insert an image into the document. By way of example, theimage element may include an src attribute that specifies a URL wherethe image is located. The object element (defined by starting and endingtags <object> and </object>, respectively) may be used to insert anobject into the document of the type specified in an included typeattribute. Another frequently used HTML element is the frameset element,which may be used as an alternative to the body element.

Generally, a web application is an application that may be accessed viaa web browser or other client application over a network, or a computersoftware application that is coded in a web browser-supported languageand reliant on a web browser to render the application executable. Webapplications have gained popularity largely as a result of the ubiquityof web browsers, the convenience of using a web browser launched at aremote computing device as a client (sometimes referred to as a thinclient), and the corresponding ability to update and maintain webapplications without distributing and installing software on remoteclients. Often, to implement a web application, the web applicationrequires access to one or more resources provided at a backend server ofan associated website. Additionally, web applications often requireaccess to additional resources associated with other applications.

Social networking system 20 may include a multitude of features withwhich users at remote clients 30 may interact during user sessions. Inparticular embodiments, these features may be implemented as webapplications and may utilize JavaScript and CSS resources requested fromservers 22 as well as other external servers or data stores. The webapplications or resources may be embedded in various underlying or baseweb pages served to remote clients, such as in frames or iFrames,sections or “divs” and the like. By way of example, the socialnetworking system hosted by Facebook(r), Inc. of Palo Alto, Calif.,includes or supports such features as the “wall,” a space on everyuser's profile page that allows friends to post messages for the user tosee; “pokes,” which allows users to send a virtual “poke” to each other(a notification that tells a user that they have been poked); “photos,”where users can upload albums and photos; “status,” which allows usersto inform their friends of their whereabouts and actions; “streams,”which may appear in multiple locations on the site, including on everyuser's homepage, which include information about the activities of theuser's connections; “notes,” a blogging feature that allows tags andembeddable images as well as blogs imported from other blogging websitesand services; as well as a large number of third party applications forwhich the website serves as a platform. In particular, a user's wall isvisible to anyone who is able to see that user's profile, depending onprivacy settings, and supports the posting of attachments as well astextual content.

In particular embodiments, the social networking system 20 maintains indata store 24 a number of objects for the different kinds of items withwhich a user may interact while accessing social networking system 20.In one example embodiment, these objects include user profiles,application objects, and message objects (such as for wall posts, emailsand other messages). In one embodiment, an object is stored by thesystem 20 for each instance of its associated item. These objects andthe actions discussed herein are provided for illustration purposesonly, and it can be appreciated that an unlimited number of variationsand features can be provided on a social networking system 20.

When a user at a client device (e.g., client device 30) desires to viewa particular web page (hereinafter also referred to as target structureddocument) hosted by social networking system 20, the user's web browser,or other document rendering engine or suitable client application,formulates and transmits a request to social networking system 20. Therequest generally includes a URL or other document identifier as well asmetadata or other information. By way of example, the request mayinclude information identifying the user, such as a user ID, as well asinformation identifying or characterizing the web browser or operatingsystem running on the user's client computing device 30. The request mayalso include location information identifying a geographic location ofthe user's client device or a logical network location of the user'sclient device. The request may also include a timestamp identifying whenthe request was transmitted.

In particular embodiments, data store 24, or other suitable data store,is further operative to maintain one or more logs of responses tosubmitted user requests for web pages. By way of example, with referenceto FIG. 2, in particular embodiments social networking system 20maintains a resource utilization log 202 in data store 24, or othersuitable data store, that logs information pertaining to requested webpages and resources required or transmitted to client devices forrendering the requested web pages. By way of example, when a pagegenerating process or program 204 executing within social networkingsystem 20 generates a structured document in response to a request for aweb page transmitted by a client device, a separate logging process 206executing within social networking system 20, or alternately, pagegenerating process 204 itself, stores or causes to be stored, a recordfor the web page in resource utilization log 202 that includesinformation associated with the response. By way of example, theinformation stored in the record may include a web page identifier(e.g., the URL of the web page) and the resources, or identifiers of theresources (such as embedded scripts, style sheets and the like),included or embedded in the web page. The record may also includeinformation identifying the user, such as a user ID, as well asinformation identifying or characterizing the web browser or operatingsystem running on the user's client computing device 30. The record mayalso include location information identifying a geographic location ofthe user's client device or a logical network location of the user'sclient device. The record may also include a timestamp identifying whenthe request was transmitted by the requesting client device, when therequest was received by social networking system 20, or when theresponse was transmitted to the client device by social networkingsystem 20.

A method for generating a resource prediction table will now bedescribed with reference to the block diagram of FIG. 2 and theflowchart of FIG. 3. In particular embodiments, social networking system20 further includes a resource prediction generating process 208 thatperiodically accesses (and scans), at 302, resource utilization log 202.By way of example, resource prediction generating process 208 mayperiodically access resource utilization log 202 on an hourly basis,daily basis, weekly basis, or on any other suitable time basis, as wellas at predetermined times or in response to certain events orconditions, including in response to receiving a request for a web pagehosted by social networking system 20. In particular embodiments,resource prediction generating process 208 scans, offline, resourceutilization log 202 for records associated with selected web pages orother structured documents. That is, in particular embodiments, resourceprediction generating process 208 only scans resource utilization log202 for records associated with the selected web pages. By way ofexample, the selected web pages may include, by way of example and notby way of limitation, home pages, user profile pages, and “canvas” pages(canvas pages may be utilized to render web applications supported bysocial networking system 20) hosted by social network system 20. Theseweb pages are generally the most “expensive” to generate and transmit,particularly in terms of network resource consumption, as they may bestatistically the most requested web pages (each registered user ofsocial networking system 20 is provided with a unique home page andprofile page) and/or may generally be characterized as rich in that theymay, by way of example, include numerous features and a variety ofmultimedia content, and as such, generally include a large number ofembedded resources to enable such richness. However, although each home,profile, or canvas page may be unique to a particular user, each ofthese web pages generally includes one or more of the same embeddedresources, particularly static resources, also embedded in other pagesof the same type associated with or requested by other users (e.g., userA's home page may often include one or more resources that are alsoincluded in user B's home page), especially when statistically comparedover the same time window of analysis.

In particular embodiments, for each of the selected web pages, resourceprediction generating process 208 analyzes the records corresponding tothat selected web page, as for example identified by a common URL orother page identifier stored in the records, across all users (e.g., allrecords for home pages regardless of user). In particular embodiments,for each selected web page, resource prediction generating process 208identifies, at 304, a subset of one or more selected resources, oridentifiers for the selected resources, from all the resourcesidentified in resource utilization log 202 corresponding to the webpage. By way of example, in particular embodiments, resource predictiongenerating process 208 computes a frequency of each resource identifiedin resource utilization log 202 as being used to render the web page.Resource prediction generating process 208 may then compute aprobability that each of the resources is likely to be embedded in theweb page in a subsequent response to a subsequent request for the webpage. By way of example, assume JavaScript resource A.js was identifiedin 84 out of 100 records corresponding to a particular web pagerequested (or for which a response was generated) over a predeterminedtime window (e.g. the last 7 days, the last month, the last year, or aselected day, week, or month of last year) as determined by a timestampincluded in each of the records. In one example embodiment, theprobability that A.js will be included or embedded within the structureddocument of the web page in response to a subsequent request for the webpage may be calculated as the number of records in which A.js isidentified divided by the total number of records corresponding to thesame web page identifier, thus yielding 84/100=0.84 or 84%. Also assumethe CSS resource B.css was identified in 47 out of the 100 recordscorresponding to the particular web page. The probability that B.csswill be included or embedded within the structured document of the webpage in response to a subsequent request for the web page may becalculated as 47/100=0.47 or 47%.

Resource prediction generating process 208 may then compare theprobability for each resource corresponding to the web page to apredetermined threshold value (which may be uniform across all selectedweb pages or be specifically predetermined for the selected web page).By way of example, a suitable threshold value may be approximately 0.80or 80% (although the threshold value may vary widely in otherembodiments or across different web pages). In particular embodiments,resource prediction generating process 208 identifies, at 304, thoseresources having a probability greater then the threshold as theselected resources corresponding to the web page. In the above example,A.js would be identified as a selected resource as 84% is greater thanthe threshold of 80%, while B.css would not be identified as a selectedresource as 47% is less than 80%.

In particular embodiments, resource prediction generating process 208then constructs or populates, at 306, a second data array 210 withindata store 24 or other suitable data store that includes the selectedweb pages and the corresponding selected resources, or identifiers forthe selected resources, for each of the selected web pages. By way ofexample the second data array 210 may take the form of a resourceprediction hash table 210 that links web page identifiers forcorresponding selected web pages with one or more resource identifierscorresponding to the selected resources identified at 304 for eachselected web page.

A method for serving a request for a web page will now be described withreference to the block diagram of FIG. 2 and the flowchart of FIG. 4. Inan example embodiment, the method begins at 402 with receiving a requestfor a web page. As described above, the request generally includes a URLor other document identifier as well as metadata or other information.By way of example, the request may include information identifying theuser, such as a user ID, as well as information identifying orcharacterizing the web browser or operating system running on the user'sclient computing device 30. The request may also include locationinformation identifying a geographic location of the user's clientdevice or a logical network location of the user's client device. Therequest may also include a timestamp identifying when the request wastransmitted. At 404, an authentication process 212 may first determine,at 404, whether the user making the request is authorized to receive theweb page.

In particular embodiments, at 406, page-generating process 204determines whether or not the requested web page is one of a subset ofselected web pages for which resource pre-fetching may be performed.That is, whether or not the requested web page is one of the selectedweb pages included in resource prediction hash table 210. If it isdetermined at 406 that the web page is a selected web page having one ormore corresponding predetermined static resources specified in the hashtable 210, then the method proceeds, at 408, with the page-generatingprocess 204 accessing hash table 210 and identifying the selectedresources predetermined to be likely required or used to generate therequested web page. In particular embodiments, page rendering process204 then formulates a first response (or first response portion) at 410comprising a first portion of a structured document that either includesthe corresponding selected resources identified in hash table 210 oridentifiers to these selected resources (e.g., in the form of script,image, or object elements having corresponding source (src) identifiersfor locating the selected resources). The first response portion is thentransmitted to the client at 412. In particular embodiments, the firstresponse portion, including the selected resources, or identifiers forthe selected resources, is formulated as a first portion of an HTML headelement of the structured document. The first portion of the HTML headelement including the selected resources may be transmitted to theclient device of the user requesting the web page over an HTTP or anyother suitable connection. In particular embodiments, the connectionover which the first response is transmitted to the client device is apersistent Transmission Control Protocol (TCP) connection. This allowsthe client to receive, and to begin processing of, resources requiredfor rendering the structured document while the remainder of the page isgenerated.

In particular embodiments, page generating process 204 then proceeds togenerate the web page (e.g., in the form of an HTML, or other structureddocument) at 414 the including structured document code and the contentto be displayed as well as the embedded resources, or embeddedidentifiers for the resources, for rendering the web page, which mayinclude those resources that have already been transmitted in oridentified in the first response portion. Page generating process 204then formulates a second response (or second response portion) at 416that includes the remainder of the structured document for rendering theweb page. That is, in particular embodiments, page generating process204 first checks which resources in the structured document have alreadybeen transmitted or identified in the first response portion transmittedto the client device such that the second response portion, which maygenerally include a second portion of the HTML head element as well as abody or frameset element, includes all the code, content, and resources(or identifiers thereof) required to render the requested web page otherthan the resources transmitted in, or identified in, the first responseportion. In particular embodiments, one or more of the resources (oridentifiers thereof) transmitted in the second response portion may betransmitted in the second portion of the HTML head element. The secondresponse portion is then transmitted to the client at 418. As describedabove, as the first response portion may be sent over a persistentconnection (e.g., a persistent HTTP or TCP connection), the secondresponse portion may be sent over the same connection. For example, thepage generating process 204 may write the data of the remainder of thestructured document to the socket that corresponds to the connectionwith the client.

In such a manner, the client device, and particularly a web browser atthe client device, may begin downloading, parsing, and executing theresources transmitted in or identified in the first response portionwhile (or before) page generating process 204 is generating thestructured document for the web page. In this way, the web browser maybegin processes associated with rendering the web page (such asaccessing and initializing scripts, etc.), before the second response iseven received and perhaps before the completed remaining portions of theweb page is even generated by page generating process 204 (i.e., therendering of the web page may overlap the generating and/or transmittingof the web page), thereby significantly reducing the latency inrendering the page and, potentially significantly increasing the networkperformance of the social networking system 20 as a whole.

In particular embodiments, if it is determined at 406 that the web pageis not a selected web page (or is a selected web page for whichpre-fetch has been disabled) having one or more correspondingpredetermined static resources specified in the resource prediction hashtable 210, then the method proceeds, according to normal operation withgenerating the web page at 414, formulating a response at 416 (in thiscase the second response portion is actually the first response portionas no first response portion was sent), and transmitting the response tothe client at 418.

Furthermore, although the described embodiments of the resourceprediction hash table 210 and methods of generating and utilizing theresource prediction hash table 210 were described at the page or URLlevel, it should be appreciated that, in other embodiments, the resourceprediction table 210 may be constructed or populated and subsequentlyutilized based on other filtering criteria. By way of example, aresource prediction table 210 may be constructed for each registereduser of social networking system 20. That is, resource predictiongenerating process 208 may scan resource utilization log 202 and filterthe records to identify likely required resources for selected web pagesas described above on a per user basis, rather than across all users asdescribed above. Moreover, any other suitable filtering criteria may beused in addition or alternately to filtering the records within resourceutilization log 202 based on web page, resource utilization probability,and/or user. By way of example, using other metadata stored in resourceutilization log 202, records may be filtered based on geographic orlogical network location (e.g., the selected resources sent in the firstresponse to a user in the United States may be different than theselected resources sent in the first response to a user in China),browser type or operation system type (e.g., the selected resources sentin the first response to a client device running the Mozilla Firefox webbrowser may be different than the selected resources sent in the firstresponse to a client device running the Internet Explorer web browser),among others.

As described herein, any of the described processes or methods can beimplemented as a series of computer-readable instructions, embodied orencoded on or within a tangible data storage medium, that when executedare operable to cause one or more processors to implement the operationsdescribed above. For smaller datasets, the operations described abovecan be executed on a single computing platform or node. By way ofexample, in particular embodiments, the phased generation processesdescribed above with reference to FIGS. 2 and 4 may be implemented by asingle server process executing in server 22. That is, the web pagegeneration and serving processes described above may be implemented onserver 22. For larger systems and resulting data sets, parallelcomputing platforms can be used. For example, the resource logging,analyzing, filtering, predicting, and/or selecting operations discussedabove can be implemented using Hive to accomplish ad hoc querying,summarization and data analysis, as well as using as incorporatingstatistical modules by embedding mapper and reducer scripts, such asPython or Perl scripts that implement a statistical algorithm. Otherdevelopment platforms that can leverage Hadoop or other Map-Reduceexecution engines can be used as well. The Apache Software Foundationhas developed a collection of programs called Hadoop, which includes:(a) a distributed file system; and (b) an application programminginterface (API) and corresponding implementation of MapReduce.

FIG. 1 illustrates an example distributed computing system, consistingof one master server 22 a and two slave servers 22 b. In someembodiments, the distributed computing system comprises ahigh-availability cluster of commodity servers in which the slaveservers are typically called nodes. Though only two nodes are shown inFIG. 1, the number of nodes might well exceed a hundred, or even athousand or more, in some embodiments. Ordinarily, nodes in ahigh-availability cluster are redundant, so that if one node crasheswhile performing a particular application, the cluster software canrestart the application on one or more other nodes.

Multiple nodes also facilitate the parallel processing of largedatabases. In some embodiments, a master server, such as 22 a, receivesa job from a client and then assigns tasks resulting from that job toslave servers or nodes, such as servers 22 b, which do the actual workof executing the assigned tasks upon instruction from the master andwhich move data between tasks. In some embodiments, the client jobs willinvoke Hadoop's MapReduce functionality, as discussed above.

Likewise, in some embodiments, a master server, such as server 22 a,governs a distributed file system that supports parallel processing oflarge databases. In particular, the master server 22 a manages the filesystem's namespace and block mapping to nodes, as well as client accessto files, which are actually stored on slave servers or nodes, such asservers 22 b. In turn, in some embodiments, the slave servers do theactual work of executing read and write requests from clients andperform block creation, deletion, and replication upon instruction fromthe master server.

While the foregoing processes and mechanisms can be implemented by awide variety of physical systems and in a wide variety of network andcomputing environments, the server or computing systems described belowprovide example computing system architectures for didactic, rather thanlimiting, purposes.

FIG. 5 illustrates an example computing system architecture, which maybe used to implement a server 22 a, 22 b, or a client device 30. In oneembodiment, hardware system 500 comprises a processor 502, a cachememory 504, and one or more executable modules and drivers, stored on atangible computer readable medium, directed to the functions describedherein. Additionally, hardware system 500 includes a high-performanceinput/output (I/O) bus 506 and a standard I/O bus 508. A host bridge 510couples processor 502 to high performance I/O bus 506, whereas I/O busbridge 512 couples the two buses 506 and 508 to each other. A systemmemory 514 and one or more network/communication interfaces 516 coupleto bus 506. Hardware system 500 may further include video memory (notshown) and a display device coupled to the video memory. Mass storage518, and I/O ports 520 couple to bus 508. Hardware system 500 mayoptionally include a keyboard and pointing device, and a display device(not shown) coupled to bus 508. Collectively, these elements areintended to represent a broad category of computer hardware systems,including but not limited to general purpose computer systems based onthe x86-compatible processors manufactured by Intel Corporation of SantaClara, California, and the x86-compatible processors manufactured byAdvanced Micro Devices (AMD), Inc., of Sunnyvale, Calif., as well as anyother suitable processor.

The elements of hardware system 500 are described in greater detailbelow. In particular, network interface 516 provides communicationbetween hardware system 500 and any of a wide range of networks, such asan Ethernet (e.g., IEEE 802.3) network, a backplane, etc. Mass storage518 provides permanent storage for the data and programming instructionsto perform the above-described functions implemented in the servers 22a, 22 b, whereas system memory 514 (e.g., DRAM) provides temporarystorage for the data and programming instructions when executed byprocessor 502. I/O ports 520 are one or more serial and/or parallelcommunication ports that provide communication between additionalperipheral devices, which may be coupled to hardware system 500.

Hardware system 500 may include a variety of system architectures; andvarious components of hardware system 500 may be rearranged. Forexample, cache 504 may be on-chip with processor 502. Alternatively,cache 504 and processor 502 may be packed together as a “processormodule,” with processor 502 being referred to as the “processor core.”Furthermore, certain embodiments of the present invention may notrequire nor include all of the above components. For example, theperipheral devices shown coupled to standard I/O bus 508 may couple tohigh performance I/O bus 506. In addition, in some embodiments, only asingle bus may exist, with the components of hardware system 500 beingcoupled to the single bus. Furthermore, hardware system 500 may includeadditional components, such as additional processors, storage devices,or memories.

In one implementation, the operations of the embodiments describedherein are implemented as a series of executable modules run by hardwaresystem 500, individually or collectively in a distributed computingenvironment. In a particular embodiment, a set of software modulesand/or drivers implements a network communications protocol stack,parallel computing functions, browsing and other computing functions,optimization processes, and the like. The foregoing functional modulesmay be realized by hardware, executable modules stored on a computerreadable medium, or a combination of both. For example, the functionalmodules may comprise a plurality or series of instructions to beexecuted by a processor in a hardware system, such as processor 502.Initially, the series of instructions may be stored on a storage device,such as mass storage 518. However, the series of instructions can betangibly stored on any suitable storage medium, such as a diskette,CD-ROM, ROM, EEPROM, etc. Furthermore, the series of instructions neednot be stored locally, and could be received from a remote storagedevice, such as a server on a network, via network/communicationsinterface 516. The instructions are copied from the storage device, suchas mass storage 518, into memory 514 and then accessed and executed byprocessor 502.

An operating system manages and controls the operation of hardwaresystem 500, including the input and output of data to and from softwareapplications (not shown). The operating system provides an interfacebetween the software applications being executed on the system and thehardware components of the system. Any suitable operating system may beused, such as the LINUX Operating System, the Apple Macintosh OperatingSystem, available from Apple Computer Inc. of Cupertino, Calif., UNIXoperating systems, Microsoft (r) Windows(r) operating systems, BSDoperating systems, and the like. Of course, other implementations arepossible. For example, the functions described herein may be implementedin firmware or on an application specific integrated circuit.

Furthermore, the above-described elements and operations can becomprised of instructions that are stored on storage media. Theinstructions can be retrieved and executed by a processing system. Someexamples of instructions are software, program code, and firmware. Someexamples of storage media are memory devices, tape, disks, integratedcircuits, and servers. The instructions are operational when executed bythe processing system to direct the processing system to operate inaccord with the invention. The term “processing system” refers to asingle processing device or a group of inter-operational processingdevices. Some examples of processing devices are integrated circuits andlogic circuitry. Those skilled in the art are familiar withinstructions, computers, and storage media.

The present disclosure encompasses all changes, substitutions,variations, alterations, and modifications to the example embodimentsherein that a person having ordinary skill in the art would comprehend.Similarly, where appropriate, the appended claims encompass all changes,substitutions, variations, alterations, and modifications to the exampleembodiments herein that a person having ordinary skill in the art wouldcomprehend. By way of example, while embodiments of the presentdisclosure have been described as operating in connection with a socialnetworking website, various embodiments of the present invention can beused in connection with any communications facility that supports webapplications. Furthermore, in some embodiments the term “web service”and “web site” may be used interchangeably and additionally may refer toa custom or generalized API on a device, such as a mobile device (e.g.,cellular phone, smart phone, personal GPS, personal digital assistance,personal gaming device, etc.), that makes API calls directly to aserver.

What is claimed is:
 1. A method comprising, by a client device: sending,to a computer server system, a request for a structured document;receiving, from the computer server in a first response phase, a firstresponse portion comprising one or more first resources associated withthe structured document or references to the one or more firstresources; processing the one or more first resources for rendering apart of the structured document; and receiving, from the computer systemin a second response phase that is subsequent to the first responsephase, a second response portion from comprising one or more secondresources associated with the structured document or references to theone or more second resources, the one or more second resources beingdifferent than the one or more first resources.
 2. The method of claim1, wherein: the structured document comprises a Hyper Text MarkupLanguage (HTML) document; the HTML document comprises a head element andone or more other HTML elements; the first response portion comprises afirst portion of the head element; and the second response portioncomprises a second portion of the head element and the one or more otherHTML elements.
 3. The method of claim 1, wherein one or more of thefirst resources or one or more of the second resources comprise aJavaScript script, a Cascading Style Sheet (CSS) resource, a webapplication resource, an image resource, a video resource, or an audioresource.
 4. The method of claim 1, wherein, for each of the one or morefirst resources, a likelihood that the first resource will be includedin a response to a future request for the structured document exceeds afirst predetermined threshold.
 5. The method of claim 1, wherein one ormore of the first resources have been previously determined to have atleast a predetermined probability to be included in a response to afuture request for the structured document that exceeds a predeterminedthreshold value.
 6. The method of claim 1, wherein the first responseportion and the second response portion are received by the clientdevice over a persistent network connection.
 7. The method of claim 1,wherein the processing the one or more first resources for rendering apart of the structured document comprises: parsing one or more of thefirst resources, or executing one or more of the first resources.
 8. Aclient device comprising: one or more processors; and a memory coupledby the processors comprising instructions executable by the processors,the processors being operable when executing the instructions to: send,to a computer server system, a request for a structured document;receive, from the computer server in a first response phase, a firstresponse portion comprising one or more first resources associated withthe structured document or references to the one or more firstresources; process the one or more first resources for rendering a partof the structured document; and receive, from the computer system in asecond response phase that is subsequent to the first response phase, asecond response portion from comprising one or more second resourcesassociated with the structured document or references to the one or moresecond resources, the one or more second resources being different thanthe one or more first resources.
 9. The client device of claim 8,wherein: the structured document comprises a Hyper Text Markup Language(HTML) document; the HTML document comprises a head element and one ormore other HTML elements; the first response portion comprises a firstportion of the head element; and the second response portion comprises asecond portion of the head element and the one or more other HTMLelements.
 10. The client device of claim 8, wherein one or more of thefirst resources or one or more of the second resources comprise aJavaScript script, a Cascading Style Sheet (CS S) resource, a webapplication resource, an image resource, a video resource, or an audioresource.
 11. The client device of claim 8, wherein, for each of the oneor more first resources, a likelihood that the first resource will beincluded in a response to a future request for the structured documentexceeds a first predetermined threshold.
 12. The client device of claim8, wherein one or more of the first resources have been previouslydetermined to have at least a predetermined probability to be includedin a response to a future request for the structured document thatexceeds a predetermined threshold value.
 13. The client device of claim8, wherein the first response portion and the second response portionare received by the client device over a persistent network connection.14. The client device of claim 8, wherein the processing the one or morefirst resources for rendering a part of the structured documentcomprises: parsing one or more of the first resources, or executing oneor more of the first resources.
 15. One or more computer-readablenon-transitory storage media embodying software that is operable whenexecuted to: send, to a computer server system, a request for astructured document; receive, from the computer server in a firstresponse phase, a first response portion comprising one or more firstresources associated with the structured document or references to theone or more first resources; process the one or more first resources forrendering a part of the structured document; and receive, from thecomputer system in a second response phase that is subsequent to thefirst response phase, a second response portion from comprising one ormore second resources associated with the structured document orreferences to the one or more second resources, the one or more secondresources being different than the one or more first resources.
 16. Theone or more computer-readable non-transitory storage media of claim 15,wherein: the structured document comprises a Hyper Text Markup Language(HTML) document; the HTML document comprises a head element and one ormore other HTML elements; the first response portion comprises a firstportion of the head element; and the second response portion comprises asecond portion of the head element and the one or more other HTMLelements.
 17. The one or more computer-readable non-transitory storagemedia of claim 15, wherein one or more of the first resources or one ormore of the second resources comprise a JavaScript script, a CascadingStyle Sheet (CSS) resource, a web application resource, an imageresource, a video resource, or an audio resource.
 18. The one or morecomputer-readable non-transitory storage media of claim 15, wherein, foreach of the one or more first resources, a likelihood that the firstresource will be included in a response to a future request for thestructured document exceeds a first predetermined threshold.
 19. The oneor more computer-readable non-transitory storage media of claim 15,wherein one or more of the first resources have been previouslydetermined to have at least a predetermined probability to be includedin a response to a future request for the structured document thatexceeds a predetermined threshold value.
 20. The one or morecomputer-readable non-transitory storage media of claim 15, wherein theprocessing the one or more first resources for rendering a part of thestructured document comprises: parsing one or more of the firstresources, or executing one or more of the first resources.